<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.ym.b2b.cache.configcache.WebAppConfig"%>
<%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><%=WebAppConfig.getConfigMap().get("SITE-NAME") %></title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="keywords" content="<%=WebAppConfig.getConfigMap().get("SITE-NAME") %>" />
	<meta name="description" content="<%=WebAppConfig.getConfigMap().get("SITE-NAME") %>" />
	<meta http-equiv="Expires" content="0" />
	<meta http-equiv="kiben" content="no-cache" />
	
	<%@include file="/views/jsp/include/cssAndJs.jsp" %>
	<style>
		.tabs-panels{
			overflow: hidden;
		}
	</style>
</head>
<body class="easyui-layout" >


	<div data-options="region:'north',border:false"  style="height:35px;padding-top:5px;font-weight: bold;font-size:13px;font-family:'宋体';color:#FFF;text-align:center;background:url('<c:url value="/css/admin-ui/images/topbg.gif" />') repeat-x;">
		<c:import url="/views/jsp/include/header.jsp"></c:import>
	</div>
	
	<div data-options="region:'west',split:true" title="导航菜单" style="width: 165px;overflow:hidden;">
		<c:import url="/views/jsp/include/menu.jsp"></c:import>
	</div>
	
	<div data-options="region:'center',border:false" style="overflow: hidden;">
		<decorator:body />
	</div>
	<!-- 右侧
	<div collapsed="true" data-options="region:'east',split:true" iconCls="icon-reload" title="辅助工具" style="width: 165px;overflow:hidden;">
		 <c:import url="/views/jsp/include/right.jsp" />
	</div>
	 -->
	<div data-options="region:'south',border:false"  style="background:url('<c:url value="/css/admin-ui/images/topbg.gif" />');height:25px;padding-top:5px;font-weight: bold;font-size:13px;font-family:'宋体';color:#FFF;text-align:center;">
   		<c:import url="/views/jsp/include/footer.jsp" />
   </div>
   
<script>
var mainTabs;
$(function(){
mainTabs = $('#maintabs').tabs({
	fit : true,
	border : false,
	tools : [ {
		iconCls : 'ext-icon-arrow_up',
		handler : function() {
			mainTabs.tabs({
				tabPosition : 'top'
			});
		}
	}, {
		iconCls : 'ext-icon-arrow_left',
		handler : function() {
			mainTabs.tabs({
				tabPosition : 'left'
			});
		}
	}, {
		iconCls : 'ext-icon-arrow_down',
		handler : function() {
			mainTabs.tabs({
				tabPosition : 'bottom'
			});
		}
	}, {
		iconCls : 'ext-icon-arrow_right',
		handler : function() {
			mainTabs.tabs({
				tabPosition : 'right'
			});
		}
	}, {
		text : '刷新',
		iconCls : 'ext-icon-arrow_refresh',
		handler : function() {
			var panel = mainTabs.tabs('getSelected').panel('panel');
			var frame = panel.find('iframe');
			try {
				if (frame.length > 0) {
					for (var i = 0; i < frame.length; i++) {
						frame[i].contentWindow.document.write('');
						frame[i].contentWindow.close();
						frame[i].src = frame[i].src;
					}
					if (navigator.userAgent.indexOf("MSIE") > 0) {// IE特有回收内存方法
						try {
							CollectGarbage();
						} catch (e) {
						}
					}
				}
			} catch (e) {
			}
		}
	}, {
		text : '关闭',
		iconCls : 'ext-icon-cross',
		handler : function() {
			var index = mainTabs.tabs('getTabIndex', mainTabs.tabs('getSelected'));
			var tab = mainTabs.tabs('getTab', index);
			if (tab.panel('options').closable) {
				mainTabs.tabs('close', index);
			} else {
				$.messager.alert('提示', '[' + tab.panel('options').title + ']不可以被关闭！', 'error');
			}
		}
	} ]
});
}); 
/**
 * 创建新选项卡
 * @param title    选项卡标题
 * @param url      选项卡远程调用路径
 */
function addMainTab(title, url) {
   	mainTabs.addTab({
           title: title,
           href: url,
           closable: true,
           width: 'auto',
           height: 'auto'
    });
}
function addTab(title, url,medthod){
/* 	if(arguments.length == 2){
		medthod = "f";
	}
	medthod = "f";
    if(medthod=="d"){
    	addMainTab(title,url);
    }
    if(medthod=="f"){ */
	    if ($('#maintabs').tabs('exists', title)){
	        $('#maintabs').tabs('select', title);

	        //不要刷新 去掉下面
	        var current_tab = $("#maintabs").tabs('getSelected',title);
	        $("#maintabs").tabs('update',{
	             tab:current_tab,
	             options : {
	                  content : '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>'
	             }
	        });
	    } else {
	        var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';
	        $('#maintabs').tabs('add',{
	            title:title,
	            content:content,
	            closable:true
	        });
	    }
/*     } */
}

</script>
</body>
</html>